public class Test {
    public static void main(String[] args) {
        String s1 = "helloworld";
        String s2 = "helloworld";
        String s3 = new String("helloworld");
        String s4 = "hello";
        String s5 = "world";
        String s6 = s4 + s5;
        final String s7 = "hello";
        final String s8 = "world";
        String s9 = s7 + s8;
        String s10 = "hello" + "world";
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);
        System.out.println(s1 == s6);
        System.out.println(s1 == s9);
        System.out.println(s1 == s10);
    }
}
